﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Hsp.Novels.Dal
{
    /// <summary>
    /// SqlSugar基础类库
    /// </summary>
    public class SugarBase
    {
        public static readonly SqlSugarClient db;

        static SugarBase()
        {
            db = new SqlSugarClient(new ConnectionConfig() { ConfigId = "0", DbType = DbType.SqlServer, ConnectionString = Get_ConnectionString(), IsAutoCloseConnection = true });
        }

        /// <summary>
        /// 数据库连接串
        /// </summary>
        /// <returns></returns>
        public static string Get_ConnectionString()
        {
            return ConfigurationManager.ConnectionStrings["ConnStr"].ConnectionString;
        }
    }
}
